const { get_modules_of_dir } = require("../utils");

module.exports = async function register_routes(app) {
  const dir = `${__dirname}/modules`;
  const routes = await get_modules_of_dir(dir, ".route.js");
  routes.forEach((router) => {
    app.use(router.routes(), router.allowedMethods());
  });
};
